% Intrinsic and Extrinsic Camera Parameters
%
% This script file can be directly executed under Matlab to recover the camera intrinsic and extrinsic parameters.
% IMPORTANT: This file contains neither the structure of the calibration objects nor the image coordinates of the calibration points.
%            All those complementary variables are saved in the complete matlab data file Calib_Results.mat.
% For more information regarding the calibration model visit http://www.vision.caltech.edu/bouguetj/calib_doc/


%-- Focal length:
fc = [ 539.873145367055940 ; 540.074677095928564 ];

%-- Principal point:
cc = [ 331.944877270109600 ; 259.715365692243836 ];

%-- Skew coefficient:
alpha_c = 0.000000000000000;

%-- Distortion coefficients:
kc = [ 0.186202104949328 ; -0.330549355802059 ; -0.002998275178000 ; 0.002416326455425 ; 0.000000000000000 ];

%-- Focal length uncertainty:
fc_error = [ 2.722620774236312 ; 2.672742630498277 ];

%-- Principal point uncertainty:
cc_error = [ 2.870735106074034 ; 2.197489108152347 ];

%-- Skew coefficient uncertainty:
alpha_c_error = 0.000000000000000;

%-- Distortion coefficients uncertainty:
kc_error = [ 0.011317384086913 ; 0.028898067182057 ; 0.001697708463510 ; 0.002672985475848 ; 0.000000000000000 ];

%-- Image size:
nx = 640;
ny = 480;


%-- Various other variables (may be ignored if you do not use the Matlab Calibration Toolbox):
%-- Those variables are used to control which intrinsic parameters should be optimized

n_ima = 27;						% Number of calibration images
est_fc = [ 1 ; 1 ];					% Estimation indicator of the two focal variables
est_aspect_ratio = 1;				% Estimation indicator of the aspect ratio fc(2)/fc(1)
center_optim = 1;					% Estimation indicator of the principal point
est_alpha = 0;						% Estimation indicator of the skew coefficient
est_dist = [ 1 ; 1 ; 1 ; 1 ; 0 ];	% Estimation indicator of the distortion coefficients


%-- Extrinsic parameters:
%-- The rotation (omc_kk) and the translation (Tc_kk) vectors for every calibration image and their uncertainties

%-- Image #1:
omc_1 = [ 1.947529e+00 ; 2.024079e+00 ; 2.884471e-02 ];
Tc_1  = [ -1.372748e+02 ; -6.324722e+01 ; 4.733616e+02 ];
omc_error_1 = [ 3.967181e-03 ; 4.644742e-03 ; 8.684303e-03 ];
Tc_error_1  = [ 2.529059e+00 ; 1.946591e+00 ; 2.528027e+00 ];

%-- Image #2:
omc_2 = [ 2.184608e+00 ; 1.492990e+00 ; 1.173548e-01 ];
Tc_2  = [ -2.073483e+02 ; -4.428746e+01 ; 4.470870e+02 ];
omc_error_2 = [ 3.948115e-03 ; 3.879581e-03 ; 7.479704e-03 ];
Tc_error_2  = [ 2.423411e+00 ; 1.893458e+00 ; 2.617014e+00 ];

%-- Image #3:
omc_3 = [ 2.629062e+00 ; 1.240052e+00 ; -1.645729e-01 ];
Tc_3  = [ -2.033548e+02 ; -5.679568e+01 ; 5.622765e+02 ];
omc_error_3 = [ 5.121027e-03 ; 3.476328e-03 ; 9.237587e-03 ];
Tc_error_3  = [ 2.999719e+00 ; 2.331924e+00 ; 3.023715e+00 ];

%-- Image #4:
omc_4 = [ -2.028446e+00 ; -1.978941e+00 ; -4.999294e-01 ];
Tc_4  = [ -9.408351e+01 ; -7.126737e+01 ; 4.777760e+02 ];
omc_error_4 = [ 3.703590e-03 ; 4.813772e-03 ; 7.903211e-03 ];
Tc_error_4  = [ 2.546350e+00 ; 1.962265e+00 ; 2.694293e+00 ];

%-- Image #5:
omc_5 = [ -1.920887e+00 ; -1.923075e+00 ; 8.522639e-01 ];
Tc_5  = [ -5.797940e+01 ; -9.139092e+01 ; 6.163383e+02 ];
omc_error_5 = [ 4.930922e-03 ; 3.496445e-03 ; 6.787581e-03 ];
Tc_error_5  = [ 3.263061e+00 ; 2.497803e+00 ; 2.815088e+00 ];

%-- Image #6:
omc_6 = [ 2.060410e+00 ; 1.811743e+00 ; 6.470850e-02 ];
Tc_6  = [ -2.673368e+02 ; -9.834785e+01 ; 5.234378e+02 ];
omc_error_6 = [ 4.330372e-03 ; 5.229586e-03 ; 9.345402e-03 ];
Tc_error_6  = [ 2.869448e+00 ; 2.275060e+00 ; 3.115704e+00 ];

%-- Image #7:
omc_7 = [ -2.078974e+00 ; -2.125600e+00 ; 8.458249e-02 ];
Tc_7  = [ -1.319601e+02 ; -1.755850e+02 ; 5.761617e+02 ];
omc_error_7 = [ 5.795300e-03 ; 4.803233e-03 ; 1.090065e-02 ];
Tc_error_7  = [ 3.115996e+00 ; 2.369645e+00 ; 3.113562e+00 ];

%-- Image #8:
omc_8 = [ 2.199559e+00 ; 2.010917e+00 ; -5.121612e-01 ];
Tc_8  = [ -1.674509e+02 ; -3.446918e+01 ; 5.475286e+02 ];
omc_error_8 = [ 3.456804e-03 ; 4.578307e-03 ; 8.312188e-03 ];
Tc_error_8  = [ 2.887337e+00 ; 2.261644e+00 ; 2.730279e+00 ];

%-- Image #9:
omc_9 = [ 2.089051e+00 ; 1.998253e+00 ; -7.203640e-02 ];
Tc_9  = [ -5.311536e+01 ; -6.146423e+01 ; 8.447256e+02 ];
omc_error_9 = [ 6.562570e-03 ; 6.631116e-03 ; 1.456177e-02 ];
Tc_error_9  = [ 4.494693e+00 ; 3.427433e+00 ; 4.621312e+00 ];

%-- Image #10:
omc_10 = [ 1.776973e+00 ; 1.993685e+00 ; 2.195382e-01 ];
Tc_10  = [ -1.142052e+02 ; -8.476367e+01 ; 7.944284e+02 ];
omc_error_10 = [ 5.532320e-03 ; 5.576035e-03 ; 1.002448e-02 ];
Tc_error_10  = [ 4.211881e+00 ; 3.243014e+00 ; 4.227849e+00 ];

%-- Image #11:
omc_11 = [ 1.677659e+00 ; 1.854865e+00 ; 4.893409e-01 ];
Tc_11  = [ -1.175014e+02 ; -9.962348e+01 ; 7.771094e+02 ];
omc_error_11 = [ 5.090506e-03 ; 4.823935e-03 ; 7.748243e-03 ];
Tc_error_11  = [ 4.125487e+00 ; 3.174983e+00 ; 4.227960e+00 ];

%-- Image #12:
omc_12 = [ -1.965761e+00 ; -2.166332e+00 ; -8.250123e-01 ];
Tc_12  = [ -7.734336e+01 ; -3.858340e+01 ; 5.816777e+02 ];
omc_error_12 = [ 3.176888e-03 ; 5.467607e-03 ; 8.498932e-03 ];
Tc_error_12  = [ 3.083966e+00 ; 2.386033e+00 ; 3.402927e+00 ];

%-- Image #13:
omc_13 = [ -1.813283e+00 ; -1.947198e+00 ; 3.487566e-01 ];
Tc_13  = [ -3.930868e+01 ; -9.928907e+01 ; 7.078210e+02 ];
omc_error_13 = [ 4.708104e-03 ; 4.618446e-03 ; 8.034225e-03 ];
Tc_error_13  = [ 3.755483e+00 ; 2.867403e+00 ; 3.599350e+00 ];

%-- Image #14:
omc_14 = [ 1.952326e+00 ; 2.220856e+00 ; -1.196108e-02 ];
Tc_14  = [ 6.193511e+01 ; -8.583075e+01 ; 8.125443e+02 ];
omc_error_14 = [ 6.874493e-03 ; 6.358491e-03 ; 1.460770e-02 ];
Tc_error_14  = [ 4.367649e+00 ; 3.300271e+00 ; 4.317534e+00 ];

%-- Image #15:
omc_15 = [ -2.317815e+00 ; -2.109073e+00 ; 2.745948e-01 ];
Tc_15  = [ -4.157070e+02 ; -8.580695e+01 ; 7.821657e+02 ];
omc_error_15 = [ 6.787328e-03 ; 4.010886e-03 ; 1.061561e-02 ];
Tc_error_15  = [ 4.351929e+00 ; 3.458268e+00 ; 4.605895e+00 ];

%-- Image #16:
omc_16 = [ 2.094954e+00 ; 1.973951e+00 ; 5.735226e-01 ];
Tc_16  = [ -3.975613e+02 ; -2.493733e+02 ; 7.720527e+02 ];
omc_error_16 = [ 8.697617e-03 ; 1.421108e-02 ; 2.220990e-02 ];
Tc_error_16  = [ 4.779037e+00 ; 3.275567e+00 ; 5.657482e+00 ];

%-- Image #17:
omc_17 = [ 1.974078e+00 ; 2.012176e+00 ; 1.733631e-01 ];
Tc_17  = [ -4.223508e+02 ; 4.501580e+01 ; 8.093801e+02 ];
omc_error_17 = [ 1.303142e-02 ; 1.685040e-02 ; 2.568664e-02 ];
Tc_error_17  = [ 4.486453e+00 ; 3.564676e+00 ; 5.230827e+00 ];

%-- Image #18:
omc_18 = [ 2.237575e+00 ; 2.111661e+00 ; 1.573554e-01 ];
Tc_18  = [ -2.544735e+01 ; 4.975361e+01 ; 7.848421e+02 ];
omc_error_18 = [ 8.314944e-03 ; 5.794942e-03 ; 1.548028e-02 ];
Tc_error_18  = [ 4.184230e+00 ; 3.213545e+00 ; 4.412855e+00 ];

%-- Image #19:
omc_19 = [ 2.259771e+00 ; 2.139133e+00 ; 1.091620e-01 ];
Tc_19  = [ -1.323668e+01 ; -2.581188e+02 ; 8.197080e+02 ];
omc_error_19 = [ 8.005916e-03 ; 9.284334e-03 ; 1.570920e-02 ];
Tc_error_19  = [ 4.488097e+00 ; 3.376925e+00 ; 4.711650e+00 ];

%-- Image #20:
omc_20 = [ -1.796573e+00 ; -1.646210e+00 ; 8.794574e-01 ];
Tc_20  = [ -1.240662e+02 ; -5.556988e+00 ; 7.675020e+02 ];
omc_error_20 = [ 4.896976e-03 ; 3.989088e-03 ; 5.988836e-03 ];
Tc_error_20  = [ 4.050326e+00 ; 3.143865e+00 ; 3.502047e+00 ];

%-- Image #21:
omc_21 = [ 2.074744e+00 ; 1.908167e+00 ; 8.684115e-01 ];
Tc_21  = [ -7.866263e+01 ; -1.582528e+01 ; 6.651365e+02 ];
omc_error_21 = [ 6.157018e-03 ; 3.770616e-03 ; 8.066014e-03 ];
Tc_error_21  = [ 3.526587e+00 ; 2.719518e+00 ; 3.901124e+00 ];

%-- Image #22:
omc_22 = [ -2.120460e+00 ; -2.211767e+00 ; 3.588513e-01 ];
Tc_22  = [ -1.633527e+02 ; -8.287232e+01 ; 5.133871e+02 ];
omc_error_22 = [ 4.673317e-03 ; 3.712000e-03 ; 8.306481e-03 ];
Tc_error_22  = [ 2.716202e+00 ; 2.121824e+00 ; 2.628969e+00 ];

%-- Image #23:
omc_23 = [ 2.054953e+00 ; 2.085181e+00 ; -1.549718e-01 ];
Tc_23  = [ -1.807873e+02 ; -7.421634e+01 ; 6.681647e+02 ];
omc_error_23 = [ 5.765126e-03 ; 6.596821e-03 ; 1.255331e-02 ];
Tc_error_23  = [ 3.552681e+00 ; 2.750693e+00 ; 3.474862e+00 ];

%-- Image #24:
omc_24 = [ -2.456735e+00 ; -1.670277e+00 ; -7.387213e-01 ];
Tc_24  = [ -2.019531e+02 ; -8.861066e+01 ; 4.607631e+02 ];
omc_error_24 = [ 5.129674e-03 ; 3.665385e-03 ; 9.461303e-03 ];
Tc_error_24  = [ 2.519564e+00 ; 1.969452e+00 ; 2.849738e+00 ];

%-- Image #25:
omc_25 = [ 1.588794e+00 ; 1.972162e+00 ; 2.167987e-01 ];
Tc_25  = [ -2.210955e+02 ; -6.426144e+01 ; 5.293717e+02 ];
omc_error_25 = [ 3.717155e-03 ; 5.147354e-03 ; 7.362637e-03 ];
Tc_error_25  = [ 2.890446e+00 ; 2.243596e+00 ; 3.028156e+00 ];

%-- Image #26:
omc_26 = [ -2.578744e+00 ; -1.373440e+00 ; 6.828112e-01 ];
Tc_26  = [ -1.954921e+02 ; -1.049345e+01 ; 5.541605e+02 ];
omc_error_26 = [ 5.300626e-03 ; 2.001785e-03 ; 7.733386e-03 ];
Tc_error_26  = [ 2.936948e+00 ; 2.298125e+00 ; 2.697912e+00 ];

%-- Image #27:
omc_27 = [ 2.078654e+00 ; 2.155780e+00 ; -2.501719e-01 ];
Tc_27  = [ -9.489267e+01 ; -7.678354e+01 ; 6.958058e+02 ];
omc_error_27 = [ 5.824991e-03 ; 6.471991e-03 ; 1.345016e-02 ];
Tc_error_27  = [ 3.697374e+00 ; 2.821277e+00 ; 3.563542e+00 ];

